# Maintainer: Jonas Witschel <diabonas@archlinux.org>
pkgname=jose
pkgver=11
_commit=145c41a4ec70c15f6f8aa12a915e16cb60f0991f # git rev-parse "v$pkgver^{}"
pkgrel=2
pkgdesc='C-language implementation of Javascript Object Signing and Encryption'
arch=('loong64' 'x86_64')
url='https://github.com/latchset/jose'
license=('APACHE')
depends=('jansson' 'openssl' 'zlib')
makedepends=('git' 'asciidoc' 'meson')
options=('debug')
source=("git+$url.git?signed#commit=$_commit")
sha512sums=('SKIP')
validpgpkeys=('7CE2CB3D2AF59FE1EA22F551D0D219ED1F7E762C') # Sergio Correia <scorreia@redhat.com>

pkgver() {
	cd "$pkgname"
	git describe --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g'
}

build() {
	cd "$pkgname"
	meson --prefix=/usr --buildtype=plain build
	meson compile -C build
}

check() {
	cd "$pkgname"
	meson test -C build
}

package() {
	cd "$pkgname"
	DESTDIR="$pkgdir" meson install -C build
}
